#include <stdio.h>

int main(){
    int arr1[] = {2,3,4,4,5,6,7};
    int arr2[] = {1,2,2,4,6,8,8};

    int t[1024] = {0};  //初始化为 0，做标记数组
    int len1 = sizeof(arr1) / sizeof(arr1[1]); 
    int len2 = sizeof(arr2) / sizeof(arr2[1]);

    for (int i = 0; i < len1; i++)
    {
        if (t[arr1[i]] == 0)
        {
            t[arr1[i]]++;
        }
        else{
            continue;
        }
    }

    for (int i = 0; i < len2; i++)
    {
        if (t[arr2[i]] != 0)
        {
            t[arr2[i]]++;
        }
        else{
            continue;
        }
    }

    for (int i = 0; i < 1024; i++)
    {
        if (t[i] > 1)
        {
            printf("%d ",i);
        }
    }
    
    
    return 0;
}